package com.hornsun.util;

import java.util.Date;

/**
 * Created by 编译中... on 2018/5/3.
 */
public class Singleton {
    private static Singleton singleton = new Singleton();
    private static long time= 0;
    private static int num = 0;
    public static String getOrderNum(){
        Date date = new Date();
        long timestamp = date.getTime()/1000;
        if (timestamp==time){
            return String.valueOf(timestamp)+(++num);
        }else {
            time=timestamp;
            num=0;
            return String.valueOf(timestamp)+num;
        }

    }
}
